function prepareGrantUser(){
    var rows=$("#userTb").bootstrapTable("getSelections");
    if(rows.length==0){
        swal({
            title:'信息提示',
            text:"请选择一项待授权！",
            type:"warning",
            confirmButtonText:"确定"
        });
        return;
    }
    var roleId=rows[0].roleId;
    $("#roleTb").bootstrapTable("checkBy",{field:"id",values:[roleId]});
    $("#grant").dialog("open");

}

$(document).ready(function(){
    $("#grant").dialog({
        title:"用户授权",
        btnName:"确认授权",
        btnBind:function(){
            var rows01=$("#userTb").bootstrapTable("getSelections");
            var rows02=$("#roleTb").bootstrapTable("getSelections");
            var param="id="+rows01[0].id+"&roleId="+rows02[0].id;
            $.post(ctx+"user/user/grant",param,function(msg){
                toastr.warning("信息提示",msg);
                $("#grant").dialog("close");
                $("#userTb").bootstrapTable("refresh");
            },'text');
        }
    });
});

